package vsp;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;

import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;

public class IOTest {

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {

//		String newline = System.getProperty("line.separator");		
		
		FileOutputStream fos = new FileOutputStream("src/vsp/t.tmp");
		ObjectOutputStream oos = new ObjectOutputStream(fos);

		oos.writeInt(12345);
		
		oos.writeObject("Today");
		oos.writeObject(new Date());

		oos.close();
		
		System.out.println("geschrieben");
		
		
		FileInputStream fis = new FileInputStream("src/vsp/t.tmp");
		
		ObjectInputStream ois = new ObjectInputStream(fis);

		int i = ois.readInt();
		System.out.println(i);
		String today;
		try {
			today = (String) ois.readObject();
			System.out.println(today);
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		try {
			Date date = (Date) ois.readObject();
			System.out.println(date);
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		ois.close();
		
	}

}
